* This is replication code for Vossler and Holladay (J Pub Econ., 2018)
* "Alternative value elicitation formats in contingent valuation: Mechanism design and convergent validity." 
* The accompanying data files, VH_Exp1.dta & VH_Exp2.dta, contain data needed to replicate results.
* Please direct any questions to Christian Vossler (cvossler@utk.edu)


****************
* Experiment 1 *
****************
clear all
/* specify file location */
use "C:\Research\VH_Exp1.dta", clear

****************************
* Data analysis and Tables *
****************************
* Table 3
* summary statistics by treatment, Experiment 1
// If needed to use 'estpost' command, run the next line
// net install st0085_2.pkg
estimates clear
estpost tabstat Income Female EnvOrg FloodInsurance DamagedSandy EvacuatedSandy Basement ExtremeSports Inconsequential, by(treatment) stat(mean sd) nototal columns(statistics) listwise
esttab using "Exp1_sum_stat", cell(mean(fmt(%15.2f)) sd(par fmt(%15.2f))) nostar unstack style(tab) nonum label notes replace varwidth(30) title(Summary statistics by treatment, Experiment 1.) ///
varlabels(Income "Income (thousands US$)" Female "Female" EnvOrg "Environmental org. member" FloodInsurance "Flood Insurance" DamagedSandy "Damaged in Hurricane Sandy" EvacuatedSandy "Evacuated in Hurricane Sandy" Basement "Basement" ExtremeSports "Extreme sport participant" Inconsequential "Inconsequential") ///	
addnotes("Notes: Table entries are sample means, with standard deviations in parentheses. Summary" "statistics are for households that live inside the 100-year flood zone. Flood insurance is an" "indicator for households indicating they have an active flood insurance policy. Damaged" "and Evacuated in Hurricane Sandy are indicators for respondents who answered yes to" "those questions. Inconsequential is an indicator for respondents stating either that they" "did not believe their vote would not affect the probability that the flood control system" "was built or that if it was built they would not have to pay. See the main text for details.")

* Table 5
* Proportion of yes votes by cost level, Experiment 1
* Theory-driven payment card
sum PC_50cent PC_1-PC_50
* Single binary choice (SBC)
tab SBC_bid SBC_vote, row nofreq

* Table 7
* Experiment 1 payment consequentiality
tab treatment PaymentConsequential, row chi nofreq label

* Table 8 
* Experiment 1 policy consequentiality
tab treatment PolicyConsequential, row chi nofreq label

**Define control variable macro (covariates demeaned for interpretation purpose)
global Controls_demean Income_demean Female_demean EnvOrg_demean FloodInsurance_demean DamagedSandy_demean EvacuatedSandy_demean Basement_demean ExtremeSports_demean

* Table 11
* Willingness-to-pay regressions for Experiment 1
* Model (1)
estimates clear
* Baseline model excluding controls
eststo: intreg LB UB PC, het(PC) robust 
** Estimates of standard deviations, as 'intreg' reports ln(SD)
nlcom exp([lnsigma]_cons+[lnsigma]PC) - exp([lnsigma]_cons)
nlcom exp([lnsigma]_cons)

* Baseline model restricted sample		
* Model (2)													
eststo: intreg LB UB PC if all_controls==1, het(PC) robust
** Estimates of standard deviations, as 'intreg' reports ln(SD)
nlcom exp([lnsigma]_cons+[lnsigma]PC) - exp([lnsigma]_cons)
nlcom exp([lnsigma]_cons)

* Baseline model with controls
* Model (3)
eststo: intreg LB UB PC SBC_Inconsequential PC_Inconsequential $Controls_demean, het(PC) robust 
** Estimates of standard deviations, as 'intreg' reports ln(SD)
nlcom exp([lnsigma]_cons+[lnsigma]PC) - exp([lnsigma]_cons)
nlcom exp([lnsigma]_cons)

esttab using "Experiment1_Models", cells(b(star fmt(%15.2f)) se(par fmt(%15.2f))) starlevels(* .10 ** .05 *** .01) stats(ll N, fmt(3 0) labels("log-L" "N")) style(tab) varwidth(50) title(Willingness-to-pay regressions for Experiment 1.) nomti label wrap notes replace ///
varlabels(PC "Theory-driven payment card (PC)" SBC_Inconsequential "Inconsequential * single binary choice (SBC)"  PC_Inconsequential "Inconsequential *  theory-driven PC" Income_demean "Income (thousands US$)" Female_demean "Female" EnvOrg_demean "Environmental org. member" FloodInsurance_demean "Flood Insurance" DamagedSandy_demean "Damaged in Hurricane Sandy" EvacuatedSandy_demean "Evacuated in Hurricane Sandy" Basement_demean "Basement" ExtremeSports_demean "Extreme sport participant" _cons "Constant") ///	
addnotes("Notes: Inconsequential is an indicator equal to 1 for respondents with stated" "beliefs inconsistent with payment and/or policy consequentiality as described in the" "main text. All sociodemographic and house characteristics have been demeaned to ease" "interpretation. Robust standard errors reported in parentheses. *** significant at the 1%" "level, ** significant at the 5% level and * significant at the 10% level.")


****************
* Experiment 2 *
****************

clear all
/* specify file location */
use "C:\Research\VH_Exp2.dta", clear

****************************
* Data analysis and Tables *
****************************
* Table 4
* summary statistics by treatment, Experiment 2
// If needed to use 'estpost' command, run the next line
// net install st0085_2.pkg
estimates clear
estpost tabstat Income Female EnvOrg FloodInsurance DamagedSandy EvacuatedSandy Basement ExtremeSports Inconsequential, by(treatment) stat(mean sd) nototal columns(statistics) listwise
esttab using "Exp2_sum_stat", cell(mean(fmt(%15.2f)) sd(par fmt(%15.2f))) nostar unstack style(tab) nonum label notes replace varwidth(30) title(Summary statistics by treatment, Experiment 2.) ///
varlabels(Income "Income (thousands US$)" Female "Female" EnvOrg "Environmental org. member" FloodInsurance "Flood Insurance" DamagedSandy "Damaged in Hurricane Sandy" EvacuatedSandy "Evacuated in Hurricane Sandy" Basement "Basement" ExtremeSports "Extreme sport participant" Inconsequential "Inconsequential") ///	
addnotes("Notes: Table entries are sample means, with standard deviations in parentheses. Summary" "statistics are for households that live just outside the 100-year flood zone. Flood insurance" "is an indicator for households indicating they have an active flood insurance policy. Damaged" "and Evacuated in Hurricane Sandy are indicators for respondents who answered yes to" "those questions. Inconsequential is an indicator for respondents stating either that they" "did not believe their vote would not affect the probability that the flood control system" "was built or that if it was built they would not have to pay. See the main text for details.")

* Table 6
* Proportion of yes votes by cost level, Experiment 2
* Single binary choice (SBC)
tab SBC_bid SBC_vote, row nofreq
* Theory-driven open ended
quietly {
foreach number in 50 35 20 15 10 7 5 3 2 1 {
	sum  OEtheory if OEtheory_WTP>=`number' & OEtheory==1
	scalar p_`number' = r(N)/244
} 
	sum  OEtheory if OEtheory_WTP>=0.5 & OEtheory==1
	scalar p_50cents = r(N)/244
}
scalar list
scalar drop _all
* Standard open ended
quietly {
foreach number in 50 35 20 15 10 7 5 3 2 1 {
	sum  OEstandard if OEstandard_WTP>=`number' & OEstandard==1
	scalar p_`number' = r(N)/249
}
	sum  OEstandard if OEstandard_WTP>=0.5 & OEstandard==1
	scalar p_50cents = r(N)/249
} 
scalar list
scalar drop _all

* Table 9
* Experiment 2 payment consequentiality
tab treatment PaymentConsequential, row chi nofreq label

** Pairwise comparisons
tab treatment PaymentConsequential if treat!=1, row chi nofreq
tab treatment PaymentConsequential if treat!=2, row chi nofreq
tab treatment PaymentConsequential if treat!=3, row chi nofreq

* Table 10 
* Experiment 2 policy consequentiality
tab treatment PolicyConsequential, row chi nofreq

**Define control variable macro 
global Controls_demean Income_demean Female_demean EnvOrg_demean FloodInsurance_demean DamagedSandy_demean EvacuatedSandy_demean Basement_demean ExtremeSports_demean

* Table 12
* Willingness-to-pay regressions for Experiment 2
* Model (4)
estimates clear
* Baseline model excluding controls
eststo: intreg LB UB OEtheory OEstandard, het(OEtheory OEstandard) robust 
** Estimates of standard deviations, as 'intreg' reports ln(SD)
nlcom exp([lnsigma]_cons+[lnsigma]OEtheory) - exp([lnsigma]_cons)
nlcom exp([lnsigma]_cons+[lnsigma]OEstandard) - exp([lnsigma]_cons)
nlcom exp([lnsigma]_cons)
** WTP estimates for OE treatments
lincom _cons + OEtheory
lincom _cons + OEstandard
** Test OEtheory=OEstandard_WTP
test OEtheory=OEstandard

* Baseline model restricted sample		
* Model (5)													
eststo: intreg LB UB OEtheory OEstandard if all_controls==1, het(OEtheory OEstandard) robust
** Estimates of standard deviations, as 'intreg' reports ln(SD)							
nlcom exp([lnsigma]_cons+[lnsigma]OEtheory) - exp([lnsigma]_cons)
nlcom exp([lnsigma]_cons+[lnsigma]OEstandard) - exp([lnsigma]_cons)
nlcom exp([lnsigma]_cons)
** WTP estimates for OE treatments
lincom _cons + OEtheory
lincom _cons + OEstandard
** Test OEtheory=OEstandard 
test OEtheory=OEstandard

* Baseline model with controls
* Model (6)
eststo: intreg LB UB OEtheory OEstandard SBC_Inconsequential OEt_Inconsequential OEs_Inconsequential $Controls_demean, het(OEtheory OEstandard) robust 
** Estimates of standard deviations, as 'intreg' reports ln(SD)	
nlcom exp([lnsigma]_cons+[lnsigma]OEtheory) - exp([lnsigma]_cons)
nlcom exp([lnsigma]_cons+[lnsigma]OEstandard) - exp([lnsigma]_cons)
nlcom exp([lnsigma]_cons)
** WTP estimates for OE treatments
lincom _cons + OEtheory
lincom _cons + OEstandard
lincom _cons + SBC_Inconsequential
lincom _cons + OEtheory + OEt_Inconsequential
lincom _cons + OEstandard + OEs_Inconsequential
** Test OEtheory=OEstandard
test OEtheory=OEstandard

esttab using "Experiment2_Models", cells(b(star fmt(%15.2f)) se(par fmt(%15.2f))) starlevels(* .10 ** .05 *** .01) stats(ll N, fmt(3 0) labels("log-L" "N")) style(tab) varwidth(50) title(Willingness-to-pay regressions for Experiment 2.) nomti label wrap notes replace ///
varlabels(OEtheory "Theory-driven open-ended (OE)" OEstandard "Standard OE" SBC_Inconsequential "Inconsequential x single binary choice (SBC)"  OEt_Inconsequential "Inconsequential x theory-driven OE" OEs_Inconsequential "Inconsequential x standard OE" Income_demean "Income (thousands US$)" Female_demean "Female" EnvOrg_demean "Environmental org. member" FloodInsurance_demean "Flood Insurance" DamagedSandy_demean "Damaged in Hurricane Sandy" EvacuatedSandy_demean "Evacuated in Hurricane Sandy" Basement_demean "Basement" ExtremeSports_demean "Extreme sport participant" _cons "Constant") ///	
addnotes("Notes: Inconsequential is an indicator equal to 1 for respondents with stated beliefs incon-" "sistent with payment and/or policy consequentiality as described in the main text. All" "sociodemographic and house characteristics have been demeaned to ease interpretation." "Specification allows for heterogeneous variances across treatments. Robust standard" "errors reported in parentheses. *** significant at the 1% level, ** significant at the 5%" "level and * significant at the 10% level.")



